REMOTE_PATH="[INSERT SOURCE ZIP PATH]/sdk-repo-linux-system-images-eng.adam.zip"
LOCAL_TEMP="/tmp/download.zip"
DEST="[INSERT ANDROID SDK PATH]/sdk/system-images/android-50/default/"
DEFAULT_EMULATOR_NAME="Humane_AI_Pin_Zygote"
DEVICE_NAME="Humane AI Pin"

adb emu kill
sleep 3
rm -Rf ~/.android/avd/$DEFAULT_EMULATOR_NAME.avd ~/.android/avd/$DEFAULT_EMULATOR_NAME.ini

rm -Rf "$DEST/arm64-v8a"
cp "$REMOTE_PATH" "$LOCAL_TEMP"
unzip -o "$LOCAL_TEMP" -d "$DEST"
cp package.xml "$DEST/arm64-v8a"
rm "$LOCAL_TEMP"

[INSERT ANDROID SDK PATH]/sdk/cmdline-tools/latest/bin/avdmanager create avd -n "$DEFAULT_EMULATOR_NAME" -d "$DEVICE_NAME" -k "system-images;android-50;default;arm64-v8a"